#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void print(int* p, int se) {
	for (int i = 0; i < se; i++) {
		printf("%d ", *(p + i));
	}
}
void A (int*p,int nub) {
	int* ret=p;
	for (int i = 1; i < nub; i++) {
		if (p[i] < *ret)
			ret = p + i;
	}
	int tmp = *p;
	*p = *ret;
	*ret = tmp;
	if (nub != 2) {
		A(p + 1, nub - 1);
	}
}
int main() {

	int arr[10] = { 10,9,8,7,6,5,5,3,2,1};
	int se = sizeof(arr) / sizeof(arr + 0);
	A(arr, se);
	print(arr, se);
	return 0;
}